package dk.modified.reshary;

import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;

public class FragmentPageIntro extends Fragment{
	private Button cmd_begin;
	private Button cmd_skip;

	public FragmentPageIntro() {

	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View rootView = inflater.inflate(R.layout.fragment_page_intro, container,
				false);
		setViews(rootView);
		setOnClickListeners();
		return rootView;
	}

	private void setViews(View v) {
		cmd_begin = (Button) v.findViewById(R.id.cmd_begin);
		cmd_skip = (Button) v.findViewById(R.id.cmd_skip);
	}

	private void setOnClickListeners() {
		
		cmd_begin.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				getActivity().getFragmentManager().beginTransaction()
						.replace(R.id.container, new FragmentPageOne())
						.commit();
			}
		});
		
		cmd_skip.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				getActivity().onBackPressed();
			}
		});
	}
}
